package com.example.by.test;


import android.os.Handler;
import android.os.Message;

/**
 * Created by BY on 2016/4/25.
 */
public class LoadingThread extends Thread {
    private String url;
    private Handler handler;

    public LoadingThread(String url, Handler handler) {
        this.url = url;
        this.handler = handler;
    }


    @Override
    public void run() {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        Message msg=handler.obtainMessage();
        msg.what=0;
        msg.obj=url;
        msg.sendToTarget();
    }
}
